﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using Windows.ApplicationModel;

namespace CorpStoreTasks
{
    internal class PackageInfo
    {
        public string Name { get; set; }
        public string FamilyName { get; set; }
        public string CreateDate { get; set; }
        public string InstalledLocation { get; set; }
        public string AppxFn { get; set; }
        public string StoreID { get; set; }
        public string ExeName { get; set; }

        public string DisplayName { get; set; }
        public string PublisherDisplayName { get; set; }
        public string Version { get; set; }
        public string Description { get; set; }
        public string GroupName { get; set; }
        public string Identity { get; set; }
        public string SplashScreenFn { get; set; }
        public string LogoFn { get; set; }
        public List<ScreenshotInfo> Screenshots { get; set; }
        public List<string> Features { get; set; }
        public string Args { get; set; }

        public bool IsFeatured { get; set; }

        public PackageInfo()
        {
            Screenshots = new List<ScreenshotInfo>();
            Features = new List<string>();
        }


        public string ShortDescription
        {
            get
            {
                if (Description != null)
                    return Description.Substring(0, Math.Min(Description.Length, 20));
                else
                    return "";
            }
        }


        public eAppType AppType()
        {
            eAppType myType = eAppType.unknown;
            if (!string.IsNullOrEmpty(StoreID))
                myType = eAppType.storeApp;
            else if (!string.IsNullOrEmpty(ExeName))
                myType = eAppType.win32App;
            else
                myType = eAppType.enterpriseApp;

            return myType;
        }

    }


    public enum eAppType
    {
        storeApp,
        enterpriseApp,
        win32App,
        unknown,
    }


}
